package com.ruoyi.project.zerocarbon.controller;

import com.ruoyi.common.utils.NumberUtils;

/**
 * @类名: Test
 * @描述:
 * @作者: liudf
 * @日期: 2021/7/16 9:07
 */
public class Test {
    public static void main(String[] args) {
        //发送短信
//        String url = "https://third.api.zyh365.com/api/comm/sendVerification.do";
//        String accessKeyId = "a0f215286d96449baeac25dc179a714a";
//        String accessKeySecret = "a333fe38ecc34de2b4dc0b7704a02ef5";
//        APIValidateUtil apiValidateUtil = new APIValidateUtil();
//        Map<String,String> mapv=new HashMap<String, String>();
//        mapv.put("AccessKeyId", accessKeyId);
//        mapv.put("type", "1");
//        mapv.put("tel", "18611432234");
//        try {
//            String key = apiValidateUtil.computeSignature(mapv, accessKeySecret);
//            String rspStr = "type="+"1"+"&tel="+"18611432234"+"&AccessKeyId="+mapv.get("AccessKeyId")+"&Signature="+percentEncode(key);
//            String response = HttpUtils.sendPost(url, rspStr);
//            System.out.println(response);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        //验证注册短信验证码
//        String url = "https://third.api.zyh365.com/api/comm/verification.do";
//        String accessKeyId = "a0f215286d96449baeac25dc179a714a";
//        String accessKeySecret = "a333fe38ecc34de2b4dc0b7704a02ef5";
//        APIValidateUtil apiValidateUtil = new APIValidateUtil();
//        Map<String,String> mapv=new HashMap<String, String>();
//        mapv.put("AccessKeyId", accessKeyId);
//        mapv.put("type", "1");
//        mapv.put("tel", "18611432234");
//        mapv.put("code", "6542");
//        try {
//            String key = apiValidateUtil.computeSignature(mapv, accessKeySecret);
//            String rspStr = "type="+"1"+"&tel="+"18611432234"+"&code="+"6542"+"&AccessKeyId="+mapv.get("AccessKeyId")+"&Signature="+percentEncode(key);
//            String response = HttpUtils.sendPost(url, rspStr);
//            System.out.println(response);
//            JSONObject jsonObject = JSONObject.parseObject(response);
//            if (jsonObject.get("status") != null && jsonObject.get("status").toString().equals("false")){
//                System.out.println(jsonObject.get("status").toString());
//            }else {
//                System.out.println(jsonObject.get("message").toString());
//            }
////            {"errCode":"0000","message":"验证通过","requestId":"","status":"true","token":"1626397948937179d549e32844fefaf0a7342fd3b5b98","timestamp":"","accessKeyId":"","signature":"","signatureMethod":"","signatureNonce":"","signatureVersion":""}
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        //省市区联动
//        String url = "https://third.api.zyh365.com/api/comm/basicdataTree.do";
//        String accessKeyId = "a0f215286d96449baeac25dc179a714a";
//        String accessKeySecret = "a333fe38ecc34de2b4dc0b7704a02ef5";
//        APIValidateUtil apiValidateUtil = new APIValidateUtil();
//        Map<String,String> mapv=new HashMap<String, String>();
//        mapv.put("AccessKeyId", accessKeyId);
//        mapv.put("typecode", "areatree");
////        mapv.put("parentid", "14737477846505d6208a5e781435b84e2e079304353cb");
//        mapv.put("parentid", "14760841123571f5b98eba11e682992c56dcba85b9");
//        try {
//            String key = apiValidateUtil.computeSignature(mapv, accessKeySecret);
////            String rspStr = "typecode="+"areatree"+"&parentid="+"14737477846505d6208a5e781435b84e2e079304353cb"+"&AccessKeyId="+mapv.get("AccessKeyId")+"&Signature="+percentEncode(key);
//            String rspStr = "typecode="+"areatree"+"&parentid="+"14760841123571f5b98eba11e682992c56dcba85b9"+"&AccessKeyId="+mapv.get("AccessKeyId")+"&Signature="+percentEncode(key);
//            String response = HttpUtils.sendPost(url, rspStr);
//            System.out.println(response);
////[{"code":"110000","name":"北京市","id":"1476084112356dd9738eba11e682992c56dcba85b9","_id":"1476084112356dd9738eba11e682992c56dcba85b9","text":"北京市","state":"closed","shortName":"北京"},{"code":"120000","name":"天津市","id":"1476084112357199d98eba11e682992c56dcba85b9","_id":"1476084112357199d98eba11e682992c56dcba85b9","text":"天津市","state":"closed","shortName":"天津"},{"code":"130000","name":"河北省","id":"147608411235719b488eba11e682992c56dcba85b9","_id":"147608411235719b488eba11e682992c56dcba85b9","text":"河北省","state":"closed","shortName":"河北"},{"code":"140000","name":"山西省","id":"147608411235719d698eba11e682992c56dcba85b9","_id":"147608411235719d698eba11e682992c56dcba85b9","text":"山西省","state":"closed","shortName":"山西"},{"code":"150000","name":"内蒙古自治区","id":"147608411235719e5a8eba11e682992c56dcba85b9","_id":"147608411235719e5a8eba11e682992c56dcba85b9","text":"内蒙古自治区","state":"closed","shortName":"内蒙古"},{"code":"210000","name":"辽宁省","id":"147608411235719f378eba11e682992c56dcba85b9","_id":"147608411235719f378eba11e682992c56dcba85b9","text":"辽宁省","state":"closed","shortName":"辽宁"},{"code":"220000","name":"吉林省","id":"14760841123571a0108eba11e682992c56dcba85b9","_id":"14760841123571a0108eba11e682992c56dcba85b9","text":"吉林省","state":"closed","shortName":"吉林"},{"code":"230000","name":"黑龙江省","id":"14760841123571a0f18eba11e682992c56dcba85b9","_id":"14760841123571a0f18eba11e682992c56dcba85b9","text":"黑龙江省","state":"closed","shortName":"黑龙江"},{"code":"310000","name":"上海市","id":"14760841123571a1ce8eba11e682992c56dcba85b9","_id":"14760841123571a1ce8eba11e682992c56dcba85b9","text":"上海市","state":"closed","shortName":"上海"},{"code":"320000","name":"江苏省","id":"14760841123571a2a78eba11e682992c56dcba85b9","_id":"14760841123571a2a78eba11e682992c56dcba85b9","text":"江苏省","state":"closed","shortName":"江苏"},{"code":"330000","name":"浙江省","id":"14760841123571a3848eba11e682992c56dcba85b9","_id":"14760841123571a3848eba11e682992c56dcba85b9","text":"浙江省","state":"closed","shortName":"浙江"},{"code":"340000","name":"安徽省","id":"14760841123571a4618eba11e682992c56dcba85b9","_id":"14760841123571a4618eba11e682992c56dcba85b9","text":"安徽省","state":"closed","shortName":"安徽"},{"code":"350000","name":"福建省","id":"14760841123571a53a8eba11e682992c56dcba85b9","_id":"14760841123571a53a8eba11e682992c56dcba85b9","text":"福建省","state":"closed","shortName":"福建"},{"code":"360000","name":"江西省","id":"14760841123571a6138eba11e682992c56dcba85b9","_id":"14760841123571a6138eba11e682992c56dcba85b9","text":"江西省","state":"closed","shortName":"江西"},{"code":"370000","name":"山东省","id":"14760841123571a6f18eba11e682992c56dcba85b9","_id":"14760841123571a6f18eba11e682992c56dcba85b9","text":"山东省","state":"closed","shortName":"山东"},{"code":"410000","name":"河南省","id":"14760841123571a7ce8eba11e682992c56dcba85b9","_id":"14760841123571a7ce8eba11e682992c56dcba85b9","text":"河南省","state":"closed","shortName":"河南"},{"code":"420000","name":"湖北省","id":"14760841123571a8ab8eba11e682992c56dcba85b9","_id":"14760841123571a8ab8eba11e682992c56dcba85b9","text":"湖北省","state":"closed","shortName":"湖北"},{"code":"430000","name":"湖南省","id":"14760841123571a9848eba11e682992c56dcba85b9","_id":"14760841123571a9848eba11e682992c56dcba85b9","text":"湖南省","state":"closed","shortName":"湖南"},{"code":"440000","name":"广东省","id":"14760841123571aaf78eba11e682992c56dcba85b9","_id":"14760841123571aaf78eba11e682992c56dcba85b9","text":"广东省","state":"closed","shortName":"广东"},{"code":"450000","name":"广西壮族自治区","id":"14760841123571ac728eba11e682992c56dcba85b9","_id":"14760841123571ac728eba11e682992c56dcba85b9","text":"广西壮族自治区","state":"closed","shortName":"广西"},{"code":"460000","name":"海南省","id":"14760841123571ad678eba11e682992c56dcba85b9","_id":"14760841123571ad678eba11e682992c56dcba85b9","text":"海南省","state":"closed","shortName":"海南"},{"code":"500000","name":"重庆市","id":"14760841123571adf58eba11e682992c56dcba85b9","_id":"14760841123571adf58eba11e682992c56dcba85b9","text":"重庆市","state":"closed","shortName":"重庆"},{"code":"510000","name":"四川省","id":"14760841123571ae778eba11e682992c56dcba85b9","_id":"14760841123571ae778eba11e682992c56dcba85b9","text":"四川省","state":"closed","shortName":"四川"},{"code":"520000","name":"贵州省","id":"14760841123571b0888eba11e682992c56dcba85b9","_id":"14760841123571b0888eba11e682992c56dcba85b9","text":"贵州省","state":"closed","shortName":"贵州"},{"code":"530000","name":"云南省","id":"14760841123571b1128eba11e682992c56dcba85b9","_id":"14760841123571b1128eba11e682992c56dcba85b9","text":"云南省","state":"closed","shortName":"云南"},{"code":"540000","name":"西藏自治区","id":"14760841123571b1948eba11e682992c56dcba85b9","_id":"14760841123571b1948eba11e682992c56dcba85b9","text":"西藏自治区","state":"closed","shortName":"西藏"},{"code":"610000","name":"陕西省","id":"14760841123571b3928eba11e682992c56dcba85b9","_id":"14760841123571b3928eba11e682992c56dcba85b9","text":"陕西省","state":"closed","shortName":"陕西"},{"code":"620000","name":"甘肃省","id":"14760841123571b41c8eba11e682992c56dcba85b9","_id":"14760841123571b41c8eba11e682992c56dcba85b9","text":"甘肃省","state":"closed","shortName":"甘肃"},{"code":"630000","name":"青海省","id":"14760841123571b4ba8eba11e682992c56dcba85b9","_id":"14760841123571b4ba8eba11e682992c56dcba85b9","text":"青海省","state":"closed","shortName":"青海"},{"code":"640000","name":"宁夏回族自治区","id":"14760841123571b6bb8eba11e682992c56dcba85b9","_id":"14760841123571b6bb8eba11e682992c56dcba85b9","text":"宁夏回族自治区","state":"closed","shortName":"宁夏"},{"code":"650000","name":"新疆维吾尔自治区","id":"14760841123571b7418eba11e682992c56dcba85b9","_id":"14760841123571b7418eba11e682992c56dcba85b9","text":"新疆维吾尔自治区","state":"closed","shortName":"新疆"},{"code":"710000","name":"台湾省","id":"14760841123571b9468eba11e682992c56dcba85b9","_id":"14760841123571b9468eba11e682992c56dcba85b9","text":"台湾省","state":"closed","shortName":"台湾"},{"code":"810000","name":"香港特别行政区","id":"14760841123571b9cc8eba11e682992c56dcba85b9","_id":"14760841123571b9cc8eba11e682992c56dcba85b9","text":"香港特别行政区","state":"closed","shortName":"香港"},{"code":"820000","name":"澳门特别行政区","id":"14760841123571bbce8eba11e682992c56dcba85b9","_id":"14760841123571bbce8eba11e682992c56dcba85b9","text":"澳门特别行政区","state":"closed","shortName":"澳门"},{"code":"0000485","name":"新疆生产建设兵团","id":"147755953095894f0d512954e45e9b36032382474450a","_id":"147755953095894f0d512954e45e9b36032382474450a","text":"新疆生产建设兵团","state":"closed","shortName":"建设兵团"},{"code":"901000","name":"其他","id":"14787596135921f30134d42254b3cab258f015139d530","_id":"14787596135921f30134d42254b3cab258f015139d530","text":"其他","state":"","shortName":"其他"}]
////[{"code":"140100","name":"太原市","id":"14760841123571f5b98eba11e682992c56dcba85b9","_id":"14760841123571f5b98eba11e682992c56dcba85b9","text":"太原市","state":"closed","shortName":"太原市"},{"code":"140200","name":"大同市","id":"14760841123571f7ba8eba11e682992c56dcba85b9","_id":"14760841123571f7ba8eba11e682992c56dcba85b9","text":"大同市","state":"closed","shortName":"大同市"},{"code":"140300","name":"阳泉市","id":"14760841123571f8408eba11e682992c56dcba85b9","_id":"14760841123571f8408eba11e682992c56dcba85b9","text":"阳泉市","state":"closed","shortName":"阳泉市"},{"code":"140400","name":"长治市","id":"14760841123572030f8eba11e682992c56dcba85b9","_id":"14760841123572030f8eba11e682992c56dcba85b9","text":"长治市","state":"closed","shortName":"长治市"},{"code":"140500","name":"晋城市","id":"1476084112357203998eba11e682992c56dcba85b9","_id":"1476084112357203998eba11e682992c56dcba85b9","text":"晋城市","state":"closed","shortName":"晋城市"},{"code":"140600","name":"朔州市","id":"1476084112357205978eba11e682992c56dcba85b9","_id":"1476084112357205978eba11e682992c56dcba85b9","text":"朔州市","state":"closed","shortName":"朔州市"},{"code":"140700","name":"晋中市","id":"1476084112357207a08eba11e682992c56dcba85b9","_id":"1476084112357207a08eba11e682992c56dcba85b9","text":"晋中市","state":"closed","shortName":"晋中市"},{"code":"140800","name":"运城市","id":"14760841123575e5e18eba11e682992c56dcba85b9","_id":"14760841123575e5e18eba11e682992c56dcba85b9","text":"运城市","state":"closed","shortName":"运城市"},{"code":"140900","name":"忻州市","id":"14760841123575e8cf8eba11e682992c56dcba85b9","_id":"14760841123575e8cf8eba11e682992c56dcba85b9","text":"忻州市","state":"closed","shortName":"忻州市"},{"code":"141000","name":"临汾市","id":"14760841123575ed7b8eba11e682992c56dcba85b9","_id":"14760841123575ed7b8eba11e682992c56dcba85b9","text":"临汾市","state":"closed","shortName":"临汾市"},{"code":"141100","name":"吕梁市","id":"14760841123575eeb38eba11e682992c56dcba85b9","_id":"14760841123575eeb38eba11e682992c56dcba85b9","text":"吕梁市","state":"closed","shortName":"吕梁市"}]
////[{"code":"140101","name":"市辖区","id":"14760841123583ef5d8eba11e682992c56dcba85b9","_id":"14760841123583ef5d8eba11e682992c56dcba85b9","text":"市辖区","state":"open","shortName":"市辖区"},{"code":"140105","name":"小店区","id":"14760841123583f1c58eba11e682992c56dcba85b9","_id":"14760841123583f1c58eba11e682992c56dcba85b9","text":"小店区","state":"closed","shortName":"小店区"},{"code":"140106","name":"迎泽区","id":"14760841123583f24f8eba11e682992c56dcba85b9","_id":"14760841123583f24f8eba11e682992c56dcba85b9","text":"迎泽区","state":"closed","shortName":"迎泽区"},{"code":"140107","name":"杏花岭区","id":"14760841123583f4908eba11e682992c56dcba85b9","_id":"14760841123583f4908eba11e682992c56dcba85b9","text":"杏花岭区","state":"closed","shortName":"杏花岭区"},{"code":"140108","name":"尖草坪区","id":"14760841123583f5418eba11e682992c56dcba85b9","_id":"14760841123583f5418eba11e682992c56dcba85b9","text":"尖草坪区","state":"closed","shortName":"尖草坪区"},{"code":"140109","name":"万柏林区","id":"14760841123583f77e8eba11e682992c56dcba85b9","_id":"14760841123583f77e8eba11e682992c56dcba85b9","text":"万柏林区","state":"closed","shortName":"万柏林区"},{"code":"140110","name":"晋源区","id":"14760841123583f8048eba11e682992c56dcba85b9","_id":"14760841123583f8048eba11e682992c56dcba85b9","text":"晋源区","state":"closed","shortName":"晋源区"},{"code":"140121","name":"清徐县","id":"14760841123583fa308eba11e682992c56dcba85b9","_id":"14760841123583fa308eba11e682992c56dcba85b9","text":"清徐县","state":"closed","shortName":"清徐县"},{"code":"140122","name":"阳曲县","id":"14760841123583fabb8eba11e682992c56dcba85b9","_id":"14760841123583fabb8eba11e682992c56dcba85b9","text":"阳曲县","state":"closed","shortName":"阳曲县"},{"code":"140123","name":"娄烦县","id":"14760841123583fcf78eba11e682992c56dcba85b9","_id":"14760841123583fcf78eba11e682992c56dcba85b9","text":"娄烦县","state":"closed","shortName":"娄烦县"},{"code":"140181","name":"古交市","id":"1476084112358400ca8eba11e682992c56dcba85b9","_id":"1476084112358400ca8eba11e682992c56dcba85b9","text":"古交市","state":"closed","shortName":"古交市"}]
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        //注册用户
//        String url = "https://third.api.zyh365.com/api/volunteer/reg.do";
//        String accessKeyId = "a0f215286d96449baeac25dc179a714a";
//        String accessKeySecret = "a333fe38ecc34de2b4dc0b7704a02ef5";
//        APIValidateUtil apiValidateUtil = new APIValidateUtil();
//        Map<String,String> mapv=new HashMap<String, String>();
//        mapv.put("AccessKeyId", accessKeyId);
//        mapv.put("mphone", "15669032190");
//        mapv.put("password", "12345678");
//        mapv.put("name", "name1");
//        mapv.put("idcardtype", "1");
//        mapv.put("idcard", "612527199309052620");
//        mapv.put("regprovince", "147608411235719d698eba11e682992c56dcba85b9");
//        mapv.put("regcity", "14760841123571f5b98eba11e682992c56dcba85b9");
//        mapv.put("regcounty", "14760841123583f1c58eba11e682992c56dcba85b9");
//        try {
//            String key = apiValidateUtil.computeSignature(mapv, accessKeySecret);
//            String rspStr = "&mphone="+"15669032190"+"&password="+"12345678"+"&name="+"name1"+"&idcardtype="+"1"+"&idcard="+"612527199309052620"+"&regprovince="+"147608411235719d698eba11e682992c56dcba85b9"+"&regcity="+"14760841123571f5b98eba11e682992c56dcba85b9"+"&regcounty="+"14760841123583f1c58eba11e682992c56dcba85b9"+"&AccessKeyId="+mapv.get("AccessKeyId")+"&Signature="+percentEncode(key);
//
//            String response = HttpUtils.sendPost(url, rspStr);
//            System.out.println(response);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

//        String response = "{\"errCode\":\"1102\",\"message\":\"验证码无效\",\"requestId\":\"\",\"status\":\"false\",\"token\":null,\"timestamp\":\"\",\"accessKeyId\":\"\",\"signature\":\"\",\"signatureMethod\":\"\",\"signatureNonce\":\"\",\"signatureVersion\":\"\"}";
//        JSONObject jsonObject = JSONObject.parseObject(response);
//        if (jsonObject.get("status") != null && jsonObject.get("status").toString().equals("true")){
//            return;
//        }
//        System.out.println();(jsonObject.get("message").toString());

        int count = 1 + 1;
        System.out.println(NumberUtils.buildSerial(count));
    }
}
